package com.flute.framework.util;

import com.flute.tools.util.StringUtil;

public class XpathStringUtils {
	public static String getLastPath(String xpath) {
		if (!StringUtil.isNullOrEmpty(xpath)) {
			return xpath.substring(xpath.lastIndexOf("/") + 1);
		} else {
			return "";
		}
	}

	public static boolean isValidXpath(String xpath) {
		if (!StringUtil.isNullOrEmpty(xpath)) {
			return xpath.trim().startsWith("//");
		} else {
			return false;
		}
	}
}
